<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <h1>今天天气很{{info}}</h1>
    <button @click="changeFlag">切换天气</button>
</div>
<script src="../JavaScript/vue.js"></script>
<script>
    const vm = new Vue({
        el: "#app",
        data: {
            isFlag: true,
        },
        methods: {
            changeFlag() {
                this.isFlag = !this.isFlag
            }
        },
        computed:{
            info(){
                return this.isFlag ? "炎热" : "凉爽"
            }
        }
    })
</script>
</body>
</html>
